package cn.lynch.bbs.domain;

import java.util.Date;


/**
 * 主题
 * @author lynch
 */
public class Topic {
	
	private String id;
	
	/**
	 * 主题内容（标题， 内容）
	 */
	private Reply content;
	
	/**
	 * 作者
	 */
	private User author;
	
	/**
	 * 概要）
	 */
	private String summary;
	
	/**
	 * 发表时间
	 */
	private Date postTime;
	
	/**
	 * 发帖ip
	 */
	private String postIPAddress;
	
	/**
	 * 是否可用（false则不显示）
	 */
	private boolean available;
	
	/**
	 * 帖子总页数
	 */
	private int pages;
	
	/**
	 * 所属版面
	 */
	private Forum forum;
	
	/**
	 * 总点击量
	 */
	private int totalClicks;
	/**
	 * 总回复量
	 */
	private int totalReplies;
	/**
	 * 最后回复
	 */
	private Reply lastReply;
	
	/**
	 * 最后更新时间
	 */
	private Date lastModified;
	
	private TopicType topicType;
	
	public TopicType getTopicType() {
		return topicType;
	}

	public void setTopicType(TopicType topicType) {
		this.topicType = topicType;
	}

	public Forum getForum() {
		return forum;
	}

	public void setForum(Forum forum) {
		this.forum = forum;
	}


	public boolean hasAttachments() {
		return getContent().getAttachments().size() > 0;
	}

	public int getTotalClicks() {
		return totalClicks;
	}

	public void setTotalClicks(int totalClicks) {
		this.totalClicks = totalClicks;
	}

	public int getTotalReplies() {
		return totalReplies;
	}

	public void setTotalReplies(int totalReplies) {
		this.totalReplies = totalReplies;
	}

	public Reply getLastReply() {
		return lastReply;
	}

	public void setLastReply(Reply lastReply) {
		this.lastReply = lastReply;
	}

	public Date getLastModified() {
		return lastModified;
	}

	public void setLastModified(Date lastModified) {
		this.lastModified = lastModified;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Reply getContent() {
		return content;
	}

	public void setContent(Reply content) {
		this.content = content;
	}

	public User getAuthor() {
		return author;
	}

	public void setAuthor(User author) {
		this.author = author;
	}

	public String getSummary() {
		return summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}

	public Date getPostTime() {
		return postTime;
	}

	public void setPostTime(Date postTime) {
		this.postTime = postTime;
	}

	public String getPostIPAddress() {
		return postIPAddress;
	}

	public void setPostIPAddress(String postIPAddress) {
		this.postIPAddress = postIPAddress;
	}

	public boolean isAvailable() {
		return available;
	}

	public void setAvailable(boolean available) {
		this.available = available;
	}

	public int getPages() {
		return pages;
	}

	public void setPages(int pages) {
		this.pages = pages;
	}
	
}
